package com.hqd.ch03.v4;


import com.hqd.ch03.v4.io.DefaultResourceLoader;
import com.hqd.ch03.v4.io.ResourceLoader;

import java.util.HashMap;
import java.util.Map;

public abstract class SpringImitationV4 {
    protected Map<String, Object> bdMap = new HashMap<>();
    /**
     * 资源加载器
     */
    protected ResourceLoader resourceLoader = new DefaultResourceLoader();


    public <T> T getBean(String name, Class<T> clazz) {
        return (T) bdMap.get(name);
    }


    public void setResourceLoader(ResourceLoader resourceLoader) {
        this.resourceLoader = resourceLoader;
    }
}
